// 云对象教程: https://uniapp.dcloud.net.cn/uniCloud/cloud-obj
// jsdoc语法提示教程：https://ask.dcloud.net.cn/docs/#//ask.dcloud.net.cn/article/129
module.exports = {
	_before: function () { // 通用预处理器

	},
	// 轮播图相关API ny-swiper
	async getnySwiper() {
		const db = uniCloud.database();
		const collection = db.collection("ny-swiper");
		let res = await collection.get()
		return {
			code: 200,
			msg: '查找成功!!',
			data: res.data
		}
	},
	// 修改轮播图片
	async updatenySwiper(_id, item) {
		const db = uniCloud.database();
		const collection = db.collection("ny-swiper");
		let res = await collection.doc(_id).update(item)
		return {
			code: 200,
			msg: '修改成功!!',
			data: res
		}
	}
}
